﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Simulacion.Fruits
{
    class Orange : Fruit
    {
        private double pLowMi, pLowSigma, pLowGamma, pJulA, pJulB, pHighMi, pHighSigma, pHighGamma;

        public Orange()
        {
            _life = 15;
            this.pLowMi = 4.8029;
            this.pLowSigma = 0.20619;
            this.pLowGamma = 8.9098;
            this.pJulA = 83.011;
            this.pJulB = 98.289;
            this.pHighMi = 2.1248;
            this.pHighSigma = 0.57097;
            this.pHighGamma = 225.23;

            this._pLowMin = 80;
            this._pLowMax = 200;
            this._pHighMin = 228;
            this._pHighMax = 255;
            this._pJulMin = pJulA;
            this._pJulMax = pJulB;
        }

        protected override double GetVarPeriodLow()
        {
            return Distributions.Lognormal3P.GetDistributionValue(_pLowMin, _pLowMax, pLowMi, pLowSigma, pLowGamma);
        }

        protected override double GetVarPeriodHigh()
        {
            return Distributions.Lognormal3P.GetDistributionValue(_pHighMin, _pHighMax, pHighMi, pHighSigma, pHighGamma);
        }

        protected override double GetVarPeriodJuly()
        {
            return Distributions.Uniform.GetDistributionValue(pJulA, pJulB);
        }

        protected override double GetFPeriodLow(double x)
        {
            return Distributions.Lognormal3P.fLognormal3P(x, pLowMi, pLowSigma, pLowGamma);
        }

        protected override double GetFPeriodHigh(double x)
        {
            return Distributions.Lognormal3P.fLognormal3P(x, pHighMi, pHighSigma, pHighGamma);
        }

        protected override double GetFPeriodJuly(double x)
        {
            return Distributions.Uniform.fUniform(pJulA, pJulB);
        }

        public double PLowMi
        {
            get { return pLowMi; }
            set { pLowMi = value; }
        }

        public double PLowSigma
        {
            get { return pLowSigma; }
            set { pLowSigma = value; }
        }

        public double PLowGamma
        {
            get { return pLowGamma; }
            set { pLowGamma = value; }
        }

        public double PJulA
        {
            get { return pJulA; }
            set { pJulA = value; }
        }

        public double PJulB
        {
            get { return pJulB; }
            set { pJulB = value; }
        }

        public double PHighMi
        {
            get { return pHighMi; }
            set { pHighMi = value; }
        }

        public double PHighSigma
        {
            get { return pHighSigma; }
            set { pHighSigma = value; }
        }

        public double PHighGamma
        {
            get { return pHighGamma; }
            set { pHighGamma = value; }
        }
    }
}
